<?php
/**
 *  view: edit
 *  file: profile/edit.php
 */
//$user_name = ( $user['name']!="" )?$user['name']:$user['username'];
$user_name = $user['username'];
?>

  <div id="f_main">
 	<div class="f_container">
    
    <h3>
      <?php 
      if( true == $user['is_online'])
        echo "<span class='online' title='Online'></span>";
      else
        echo "<span class='offline' title='Offline'></span>";
      ?>
      <?php echo( $user['name']!="" )?$user['name']:$user['username']; ?> (<?php echo $user['age']; ?>)
    </h3>
    <div class="block-left">
    	<?php if( NULL != $main_image ){ ?>
    	<img class="profil" src="<?php echo base_url(); ?>profile/image/small/<?php echo $user['id'] .'/'. $main_image; ?>" alt="<?php echo $user_name; ?>" />
        <?php } else { ?>
        <img class="profil" src="<?php echo base_url(); ?>img/no_image.gif" alt="" />
        <?php } ?>
        
        <?php if( $admin_edit == false ){ ?>
        <p><a class="link-edit" href="<?php echo base_url(); ?>profile/edit-photo.htm"><?php echo lang('edit_profile_picture'); ?></a></p>
        <?php } else { ?>
        <p><a class="link-edit" href="<?php echo base_url(); ?>profile/edit-photo/<?php echo $user['id']; ?>.htm"><?php echo lang('edit_profile_picture'); ?></a></p>
        <?php } ?>
        <div class="baloon"></div>
        <div class="about-me">
        <p><span><?php echo lang('flirtyy_profile_text'); ?> </span><?php echo $user['flirt_text']; ?></p>
        </div>
    </div><!--end block-left-->
    <form name="profile-form" id="profile-form" method="post"  >  
      <input type="hidden" name="user[id]" id="user_id" value="<?php echo $user['id']; ?>" />
    <div class="block">
      
    	<h4><?php echo lang('basic_information'); ?></h4>
        <div class="clr"></div>
        <div id="response"><?php echo $response; ?></div>
        <div class="profil-info">
          <table width="100%" border="0" cellspacing="7" cellpadding="0">
  
            <tr>
              <td align="right"><?php echo lang('e-mail'); ?>:</td>
              <td width="300"><input name="user[email]" id="reg_email" type="text" value='<?php echo $user['email']; ?>' ></td>
            </tr>
            <tr>
              <td align="right"><?php echo lang('full_username'); ?>:</td>
              <td width="300"><input name="user[username]" type="text" readonly="readonly" value='<?php echo $user['username']; ?>'></td>
            </tr>
            <tr>
              <td align="right"><?php echo lang('password'); ?>:</td>
              <td width="300"><input name="user[password]" id="password1" type="password"></td>
            </tr>
            <tr>
              <td align="right"><?php echo lang('repeat_password'); ?>:</td>
              <td width="300"><input name="user[repeat_password]" type="password"></td>
            </tr>
            <tr>
              <td align="right"><?php echo lang('am'); ?>:</td>
              <td width="300"><input name="user[gender]" type="radio" value="male" <?php echo ("male"==$user['gender'])?"checked":""; echo (!isset($user['gender']))?"checked":""; ?> >
                  <img src="<?php echo base_url(); ?>img/template/male.png" width="10" height="15" alt="<?php echo lang('male'); ?>" />
                  <span><?php echo lang('male'); ?></span>
                  <input name="user[gender]" type="radio" value="female" <?php echo ("female"==$user['gender'])?"checked":""; ?> >
                  <img src="<?php echo base_url(); ?>img/template/female.png" width="14" height="14" alt="<?php echo lang('female'); ?>" />
                  <span><?php echo lang('female'); ?></span></td>
            </tr>
            <tr>
              <td align="right"><?php echo lang('looking_for'); ?>:</td>
              <td width="300"><input name="user[look_for]" type="radio" value="male" <?php echo ("male"==$user['look_for'])?"checked":""; ?>>
                <img src="<?php echo base_url(); ?>img/template/male.png" width="10" height="15" alt="<?php echo lang('male'); ?>" />
                  <span><?php echo lang('male'); ?></span>
                  <input name="user[look_for]" type="radio" value="female" <?php echo ("female"==$user['look_for'])?"checked":""; echo (!isset($user['look_for']))?"checked":""; ?> >
                  <img src="<?php echo base_url(); ?>img/template/female.png" width="14" height="14" alt="<?php echo lang('female'); ?>" />
                  <span><?php echo lang('female'); ?></span>
                  <input name="user[look_for]" type="radio" value="both" <?php echo ("both"==$user['look_for'])?"checked":""; ?> >
                  <span><?php echo lang('both'); ?></span></td>
            </tr>

            <tr>
              <td align="right"><?php echo lang('your_birthday'); ?>:</td>
              <td width="300"><select name="user[birthdate][day]">
                          <option value=""><?php echo lang('day'); ?></option>
                          <option value="1" <?php echo ("1"==$user['birthdate']['day'])?"selected='selected'":""; ?> >01</option>
                          <option value="2" <?php echo ("2"==$user['birthdate']['day'])?"selected='selected'":""; ?> >02</option>
                          <option value="3" <?php echo ("3"==$user['birthdate']['day'])?"selected='selected'":""; ?> >03</option>
                          <option value="4" <?php echo ("4"==$user['birthdate']['day'])?"selected='selected'":""; ?> >04</option>
                          <option value="5" <?php echo ("5"==$user['birthdate']['day'])?"selected='selected'":""; ?> >05</option>
                          <option value="6" <?php echo ("6"==$user['birthdate']['day'])?"selected='selected'":""; ?> >06</option>
                          <option value="7" <?php echo ("7"==$user['birthdate']['day'])?"selected='selected'":""; ?> >07</option>
                          <option value="8" <?php echo ("8"==$user['birthdate']['day'])?"selected='selected'":""; ?> >08</option>
                          <option value="9" <?php echo ("9"==$user['birthdate']['day'])?"selected='selected'":""; ?> >09</option>
                          <option value="10" <?php echo ("10"==$user['birthdate']['day'])?"selected='selected'":""; ?> >10</option>
                          <option value="11" <?php echo ("11"==$user['birthdate']['day'])?"selected='selected'":""; ?> >11</option>
                          <option value="12" <?php echo ("12"==$user['birthdate']['day'])?"selected='selected'":""; ?> >12</option>
                          <option value="13" <?php echo ("13"==$user['birthdate']['day'])?"selected='selected'":""; ?> >13</option>
                          <option value="14" <?php echo ("14"==$user['birthdate']['day'])?"selected='selected'":""; ?> >14</option>
                          <option value="15" <?php echo ("15"==$user['birthdate']['day'])?"selected='selected'":""; ?> >15</option>
                          <option value="16" <?php echo ("16"==$user['birthdate']['day'])?"selected='selected'":""; ?> >16</option>
                          <option value="17" <?php echo ("17"==$user['birthdate']['day'])?"selected='selected'":""; ?> >17</option>
                          <option value="18" <?php echo ("18"==$user['birthdate']['day'])?"selected='selected'":""; ?> >18</option>
                          <option value="19" <?php echo ("19"==$user['birthdate']['day'])?"selected='selected'":""; ?> >19</option>
                          <option value="20" <?php echo ("20"==$user['birthdate']['day'])?"selected='selected'":""; ?> >20</option>
                          <option value="21" <?php echo ("21"==$user['birthdate']['day'])?"selected='selected'":""; ?> >21</option>
                          <option value="22" <?php echo ("22"==$user['birthdate']['day'])?"selected='selected'":""; ?> >22</option>
                          <option value="23" <?php echo ("23"==$user['birthdate']['day'])?"selected='selected'":""; ?> >23</option>
                          <option value="24" <?php echo ("24"==$user['birthdate']['day'])?"selected='selected'":""; ?> >24</option>
                          <option value="25" <?php echo ("25"==$user['birthdate']['day'])?"selected='selected'":""; ?> >25</option>
                          <option value="26" <?php echo ("26"==$user['birthdate']['day'])?"selected='selected'":""; ?> >26</option>
                          <option value="27" <?php echo ("27"==$user['birthdate']['day'])?"selected='selected'":""; ?> >27</option>
                          <option value="28" <?php echo ("28"==$user['birthdate']['day'])?"selected='selected'":""; ?> >28</option>
                          <option value="29" <?php echo ("29"==$user['birthdate']['day'])?"selected='selected'":""; ?> >29</option>
                          <option value="30" <?php echo ("30"==$user['birthdate']['day'])?"selected='selected'":""; ?> >30</option>
                          <option value="31" <?php echo ("31"==$user['birthdate']['day'])?"selected='selected'":""; ?> >31</option>
                      </select>
                      <select name="user[birthdate][month]">
                          <option value=""><?php echo lang('month'); ?></option>
                          <option value="1" <?php echo ("1"==$user['birthdate']['month'])?"selected='selected'":""; ?> ><?php echo lang('january'); ?></option>
                          <option value="2" <?php echo ("2"==$user['birthdate']['month'])?"selected='selected'":""; ?> ><?php echo lang('february'); ?></option>
                          <option value="3" <?php echo ("3"==$user['birthdate']['month'])?"selected='selected'":""; ?> ><?php echo lang('march'); ?></option>
                          <option value="4" <?php echo ("4"==$user['birthdate']['month'])?"selected='selected'":""; ?> ><?php echo lang('april'); ?></option>
                          <option value="5" <?php echo ("5"==$user['birthdate']['month'])?"selected='selected'":""; ?> ><?php echo lang('may'); ?></option>
                          <option value="6" <?php echo ("6"==$user['birthdate']['month'])?"selected='selected'":""; ?> ><?php echo lang('june'); ?></option>
                          <option value="7" <?php echo ("7"==$user['birthdate']['month'])?"selected='selected'":""; ?> ><?php echo lang('july'); ?></option>
                          <option value="8" <?php echo ("8"==$user['birthdate']['month'])?"selected='selected'":""; ?> ><?php echo lang('august'); ?></option>
                          <option value="9" <?php echo ("9"==$user['birthdate']['month'])?"selected='selected'":""; ?> ><?php echo lang('september'); ?></option>
                          <option value="10" <?php echo ("10"==$user['birthdate']['month'])?"selected='selected'":""; ?> ><?php echo lang('october'); ?></option>
                          <option value="11" <?php echo ("11"==$user['birthdate']['month'])?"selected='selected'":""; ?> ><?php echo lang('november'); ?></option>
                          <option value="12" <?php echo ("12"==$user['birthdate']['month'])?"selected='selected'":""; ?> ><?php echo lang('december'); ?></option>
                      </select>
                      <input class="reg-year" name="user[birthdate][year]" type="text" min="1900" maxlength="4" placeholder="<?php echo lang('year'); ?>" value='<?php echo $user['birthdate']['year']; ?>' ></td>
            </tr>
            
            <tr>
              <td align="right"><?php echo lang('postal_code'); ?>:</td>
              <td width="300"><input name="user[zip_code]" type="text" value="<?php echo $user['zip_code'] ?>" ></td>
            </tr>
            <tr>
              <td align="right" valign='top' ><?php echo lang('flirtyy_text'); ?>:</td>
              <td width="300"><textarea name="user[flirt_text]" cols="" rows=""><?php echo $user['flirt_text'] ?></textarea></td>
            </tr>
            


          </table>
        </div><!--end profil-info-->
        
        
        <div class="clr"></div>
            <input class="save" name="edit_save" type="submit" value="<?php echo lang('save_changes'); ?>">
            <div class="clr"></div>
    </div><!--end block-->
    </form>
    <div class="block-right">
    	<div class="side-module">
        
            <?php $this->load->view('modules/my_favorites'); ?>
          
        </div><!--End side-module-->
        <div class="basic-module">
          
            <?php $this->load->view('modules/whos_viewed_your_profile');  ?>
          
        </div><!--End basic-module-->
        <div class="side-module">
        
            <?php $this->load->view('modules/my_friends');  ?>
          
        </div><!--End side-module-->
    </div><!--end block-right-->
    </div><!--end f_container-->
 </div><!--end f_main-->
 <div class="clr"></div>


